package com.cxs.musicplaywidget.player;

import com.cxs.musicplaywidget.player.data.MusicData;
import com.cxs.musicplaywidget.player.data.MusicInfo;
import com.cxs.musicplaywidget.player.player.IPlayerListener;
import com.cxs.musicplaywidget.player.store.MediaStore;
import com.cxs.musicplaywidget.player.store.VolumeStore;
import ohos.utils.zson.ZSONArray;

import java.util.List;

public interface IMusicPlayer {
    String tag = IMusicPlayer.class.getSimpleName();

    void setPlayerListener(IPlayerListener playerListener);

    /**
     * start playing
     * @param music
     */
    void start(MusicInfo music);

    /**
     * play
     */
    void play();

    /**
     * Play music by index
     * @param index
     */
    void play(int index);

    /**
     * pause
     */
    void pause();

    /**
     * stop
     */
    void stop();

    void setPlayIndex(int index);
    /**
     * get current music index
     * @return
     */
    int getPlayIndex();

    /**
     * get music
     * @return
     */
    MusicInfo getMusic();

    /**
     * get music by index
     * @return
     */
    MusicInfo getMusic(int index);

    /**
     * get player state
     * @return
     */
    int getState();

    /**
     * is playing
     * @return
     */
    boolean isPlaying();

    int getCount();

    /**
     * get current playing time
     * @return
     */
    int getCurrentTime();

    /**
     * update playlist
     */
    void updatePlayList();

    List<MusicInfo> getPlayList();
    /**
     * get playlist
     * @param reload
     * @return
     */
    List<MusicInfo> getPlayList(boolean reload);

    /**
     * next
     * @return
     */
    int next();

    /**
     * previous
     * @return
     */
    int previous();

    /**
     * random play
     * @return
     */
    int random();

    /**
     * get music thumbnail
     * @return
     */
    byte[] getThumbnail();

    /**
     * get music array data
     * @return
     */
    MusicData getMusicData(int playIndex);

    /**
     * get max volume
     * @return
     */
    int getMaxVolume();

    /**
     * get current colume
     * @return
     */
    int getVolume();

    /**
     * decrease volume
     */
    void decrease();

    /**
     * increase volume
     */
    void increase();
}
